#!/usr/bin/env python
from __future__ import unicode_literals
from __future__ import absolute_import

from . import app
from .api.ViewInterface import Index, Ajax
from flask import render_template, request, jsonify, Response


@app.route("/")
def index():
    i = Index(**request.args)
    data = i.get()
    return render_template('index.html', **data)


@app.route('/ajax')
def ajax():
    web = Ajax(**request.args)
    data = web.get()
    return jsonify(**data)

if __name__ == '__main__':
    app.run(host="0.0.0.0", debug=True)
